package com.meals.system.service;

import com.meals.system.api.user.vo.WhitesMealOrderDetailVO;
import com.meals.system.api.user.vo.WhitesMealOrderItemVO;
import com.meals.system.api.user.vo.WhitesMealShoppingCartItemVO;
import com.meals.system.entity.SystemUser;
import com.meals.system.entity.SystemUserAddress;
import com.meals.system.entity.WhitesMealOrder;
import com.meals.system.util.PageQueryUtil;
import com.meals.system.util.PageResult;

import java.util.List;

/**
 * Description:
 * Parm:
 * return:
 * Author: Chen
 * Date: 2021/12/11
 */
public interface WhitesMealOrderService {

    /**
     * 根据orderId获取订单详情
     *
     * @param orderId
     * @return
     */
    WhitesMealOrderDetailVO getOrderDetailByOrderId(Long orderId);

    /**
     * 根据订单号和用户获取订单详情
     *
     * @param orderNo
     * @param userId
     * @return
     */
    WhitesMealOrderDetailVO getOrderDetailByOrderNoWithUserId(String orderNo, Long userId);

    /**
     * 获取订单列表
     *
     * @param pageUtil
     * @return
     */
    PageResult getOrders(PageQueryUtil pageUtil);

    /**
     * 取消订单
     * @param orderNo
     * @param userId
     * @return
     */
    String cancelOrder(String orderNo, Long userId);

    /**
     * 确认收货
     * @param orderNo
     * @param userId
     * @return
     */
    String confirmOrder(String orderNo, Long userId);

    /**
     * 支付成功
     * @param orderNo
     * @param payType
     * @return
     */
    String paySuccess(String orderNo, int payType);

    /**
     * 保存订单
     * @param loginSystemUser
     * @param systemUserAddress
     * @param items
     * @return
     */
    String saveOrder(SystemUser loginSystemUser, SystemUserAddress systemUserAddress, List<WhitesMealShoppingCartItemVO> items);

    /**
     * 后台分页
     * @param pageUtil
     * @return
     */
    PageResult getWhitesMealOrdersPage(PageQueryUtil pageUtil);

    /**
     * 修改订单
     * @param whitesMealOrder
     * @return
     */
    String updateOrderInfo(WhitesMealOrder whitesMealOrder);


    /**
     * 配货
     * @param ids
     * @return
     */
    String checkDone(Long[] ids);

    /**
     * 出库
     * @param ids
     * @return
     */
    String checkOut(Long[] ids);

    /**
     * 关闭订单
     * @param ids
     * @return
     */
    String closeOrder(Long[] ids);


    List<WhitesMealOrderItemVO> getOrderItems(Long orderId);


}
